package cauca.scsn.modelo.entidad.id;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * FacturaId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class FacturaId implements java.io.Serializable {

	// Fields

	private Integer idProveedor;
	private String nroFactura;

	// Constructors

	/** default constructor */
	public FacturaId() {
	}

	/** full constructor */
	public FacturaId(Integer idProveedor, String nroFactura) {
		this.idProveedor = idProveedor;
		this.nroFactura = nroFactura;
	}

	// Property accessors

	@Column(name = "id_proveedor", nullable = false)
	public Integer getIdProveedor() {
		return this.idProveedor;
	}

	public void setIdProveedor(Integer idProveedor) {
		this.idProveedor = idProveedor;
	}

	@Column(name = "nro_factura", nullable = false, length = 60)
	public String getNroFactura() {
		return this.nroFactura;
	}

	public void setNroFactura(String nroFactura) {
		this.nroFactura = nroFactura;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof FacturaId))
			return false;
		FacturaId castOther = (FacturaId) other;

		return ((this.getIdProveedor() == castOther.getIdProveedor()) || (this
				.getIdProveedor() != null && castOther.getIdProveedor() != null && this
				.getIdProveedor().equals(castOther.getIdProveedor())))
				&& ((this.getNroFactura() == castOther.getNroFactura()) || (this
						.getNroFactura() != null
						&& castOther.getNroFactura() != null && this
						.getNroFactura().equals(castOther.getNroFactura())));
	}

	public int hashCode() {
		int result = 17;

		result = 37
				* result
				+ (getIdProveedor() == null ? 0 : this.getIdProveedor()
						.hashCode());
		result = 37
				* result
				+ (getNroFactura() == null ? 0 : this.getNroFactura()
						.hashCode());
		return result;
	}

}